//
//  ZHViewController.m
//  ZHEncrypt
//
//  Created by fengzi617640388@163.com on 01/12/2018.
//  Copyright (c) 2018 fengzi617640388@163.com. All rights reserved.
//

#import "ZHViewController.h"
#import <ZHEncrypt/ZHEncrypt.h>
@interface ZHViewController ()

@property (weak, nonatomic) IBOutlet UITextView *encryptTextView;

@property (weak, nonatomic) IBOutlet UIButton *encryptButton;

@property (weak, nonatomic) IBOutlet UILabel *cipherLabel;

@property (weak, nonatomic) IBOutlet UIButton *decryptButton;


@end

@implementation ZHViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view, typically from a nib.
}

- (IBAction)encryptButton:(UIButton *)sender {
    self.cipherLabel.text = [ZHEncrypt DESEncryptWithText:self.encryptTextView.text theKey:@"12345678"];
    self.encryptTextView.text = nil;
}

- (IBAction)decryptButton:(UIButton *)sender {
    
    self.encryptTextView.text = [ZHEncrypt DESDecryptWithText:self.cipherLabel.text theKey:@"12345678"];
    
}

- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
    [self.view endEditing:YES];
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
